package com.zhouxiao.multithreading.bank;

/**
 * @author 周明阳
 * mail:gqzmy@outlook.com
 * 时间:2018-03-13 9:41
 */

public class PersonB extends Thread {

    private Bank bank;

    public PersonB(Bank bank) {
        this.bank = bank;
    }

    @Override
    public void run() {
        while (bank.getMoney() >= 200) {
            bank.ATM(200);
            try {
                sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
